
package com.sausageking.server.common;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

import com.sausageking.shared.BaseUtil;

public class ServerUtil extends BaseUtil {

  @Override
  public String encode(String string) {
    try {
      return URLEncoder.encode(string, "utf-8");
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }

  @Override
  public String decode(String string) {
    try {
      return URLDecoder.decode(string, "utf-8");
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

  }

  @Override
  public void redirect(String merchant) {
    throw new UnsupportedOperationException();
  }

}
